package com.zhkj.txg.module.home.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.lib.config.BASE_URL
import com.zhkj.txg.R
import com.zhkj.txg.module.home.entity.PromotionInfo
import com.zhkj.txg.module.home.entity.RecommendInfo
import com.zhkj.txg.module.home.entity.ShopCateSecondEntity
import com.zhkj.txg.utils.ImageUtils

class CategoryRightAdapter : BaseQuickAdapter<ShopCateSecondEntity, BaseViewHolder>(R.layout.item_cate_right) {

    override fun convert(helper: BaseViewHolder, item: ShopCateSecondEntity) {
        val imageView = helper.setText(R.id.tvCate, item.name)
            .getView<ImageView>(R.id.ivCate)
        ImageUtils.loadImage(
            context, imageView,
            if (item.image.startsWith("http")) item.image else BASE_URL + item.image
        )
    }

}